Refactor: use slice() instead of deprecated substr() to avoid future issues#111
Refactor: use slice() instead of deprecated substr() to avoid future issues#111sarraf1996 wants to merge 1 commit intoexpressjs:masterfrom
Conversation
|
When you have a moment, could you please review my pull request? I’d appreciate your feedback and any suggestions for improvement. Thank you for your time and consideration. |
|
@IamLizu Thanks for reviewing and approving this PR. As the pull request has been approved, it is now ready for merging. Please feel free to proceed if there are no further concerns. |
|
Hello, @sarraf1996. |
|
@sarraf1996 thank you for being an awesome contributor. Please allow us some time before your PR lands. @gitdevjin Good work! Do you know that you can check a PR without merging the branch? You can use, gh pr checkout 111Here 111 is the PR number in GitHub and |
|
@IamLizu Thanks for the great tip! I didn't know that. I'll definitely check it out! |

This Pull Request (PR) is created for issue #110 and needs review to merge it.
What does this PR do?
This pull request replaces all occurrences of the deprecated
substr()method withslice()in the codebase.Why is this needed?
The
substr()method is deprecated and may lead to issues or warnings in future JavaScript versions. This update ensures the code remains future-proof and compliant with modern JavaScript standards.How does it address the issue?
Each instance of
substr()has been refactored toslice()to maintain the same functionality.Are there any side effects?
This change should not introduce any side effects. Both
substr()andslice()have similar behavior, with the exception of how they handle negative indices. All instances in the codebase have been reviewed to ensure compatibility.Additional Context
For more information on the deprecation of
substr(), please refer to the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr.